package com.bw.controller;

import com.bw.entity.TbProject;
import com.bw.entity.TbUser;
import com.bw.service.ProjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
public class ProjectController {

    @Autowired
    private ProjectService projectService;


    @GetMapping("getprojectList")
    public List getprojectList(@RequestParam("mohu")String mohu){
        return projectService.getprojectList(mohu);
    };

    @GetMapping("qi")
    public void qi(@RequestParam("id")String id){
        this.projectService.qi(id);
    };
    @GetMapping("ting")
    public void ting(@RequestParam("id")String id){
        this.projectService.ting(id);
    };

    @GetMapping("delete")
    public void delete(@RequestParam("id")String id){
        this.projectService.delete(id);
    };

    @GetMapping("getuserlist")
    public List getuserlist(){
        return this.projectService.getuserlist();
    };

    @GetMapping("getinsertlist")
    public List getinsertlist(@RequestParam("mohu")String mohu){
        return this.projectService.getinsertlist(mohu);
    };

    @PostMapping("add")
    public void add(@RequestBody TbProject project){
        this.projectService.addProject(project);
    };

    @GetMapping("userfp")
    public void userfp(@RequestParam("ids")String ids,@RequestParam("id") int id){
        this.projectService.userfp(ids,id);
    };

    @GetMapping("interfp")
    public void interfp(@RequestParam("ids") String ids,@RequestParam("id") int id){
        this.projectService.interfp(ids,id);
    };
    @GetMapping("calllist")
    public List calllist(@RequestParam("tid") String tid){
        return this.projectService.calllist(tid);
    };
}
